package com.itheima.health.service;

import com.itheima.health.Exception.MyException;
import com.itheima.health.entity.PageResult;
import com.itheima.health.entity.QueryPageBean;
import com.itheima.health.pojo.Member;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *
 * </p>
 *
 * @author: Eric
 * @since: 2020/11/28
 */
public interface MemberService {

    /**
     * 通过手机号码查询
     * @param telephone
     * @return
     */
    Member findByTelephone(String telephone);

    /**
     * 添加新会员
     * @param member
     */
    void add(Member member);

    /**
     * 调用服务查询到每个最后一天为止的会员总数量
     * @param months
     * @return
     */
    List<Integer> getMemberReport(List<String> months);

    /**
     * 分页查询
     * @param queryPageBean
     * @return
     */
    PageResult<Member> findPage(QueryPageBean queryPageBean);

    /**
     * 会员信息回显
     * @param id
     * @return
     */
    Member findById(int id);

    /**
     *
     * @param id
     * @throws MyException
     */
    void deleteById(int id) throws MyException;

    /**
     * 修改会员
     * @param member
     */
    void update(Member member);

    /**
     * 获取男女比例
     * @return
     */
    List<Map<String, Object>> getGender();

    /**
     * 获取年龄段占比
     * @return
     */
    List<Map<String, Object>> getAge();


}
